package com.iotek.ssm.pojo;

import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * 入职员工考勤类
 */
public class Attendance {
    private Integer id;
    private Resume resume;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date goTime;//上班时间

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date offTime;//下班时间
    private Integer beLateTimes;//迟到时长
    private Integer leaveEarlyTimes;//早退时长
    private Float extraWorkTimes;//加班时长

    public void setResume(Resume resume) {
        this.resume = resume;
    }

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    public void setGoTime(Date goTime) {
        this.goTime = goTime;
    }

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    public void setOffTime(Date offTime) {
        this.offTime = offTime;
    }

    public void setLeaveEarlyTimes(Integer leaveEarlyTimes) {
        this.leaveEarlyTimes = leaveEarlyTimes;
    }

    public void setExtraWorkTimes(Float extraWorkTimes) {
        this.extraWorkTimes = extraWorkTimes;
    }

    public void setBeLateTimes(Integer beLateTimes) {
        this.beLateTimes = beLateTimes;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public Resume getResume() {
        return resume;
    }

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    public Date getGoTime() {
        return goTime;
    }

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    public Date getOffTime() {
        return offTime;
    }

    public Integer getBeLateTimes() {
        return beLateTimes;
    }

    public Integer getLeaveEarlyTimes() {
        return leaveEarlyTimes;
    }

    public Float getExtraWorkTimes() {
        return extraWorkTimes;
    }

    @Override
    public String toString() {
        return "Attendance{" +
                "id=" + id +
                ", resume=" + resume +
                ", goTime=" + goTime +
                ", offTime=" + offTime +
                ", beLateTimes=" + beLateTimes +
                ", leaveEarlyTimes=" + leaveEarlyTimes +
                ", extraWorkTimes=" + extraWorkTimes +
                '}';
    }
}
